Skip to main content

Interruption and Continuation of Movements

The Robotics_Interrupt_Continue.project sample project described here is located in the installation directory of CODESYS under ..\CODESYS SoftMotion\Examples.

This example shows how commanded movements can be interrupted with the SMC_GroupInterrupt function block and resumed at a later time with the SMC_GroupContinue function block. The axis group can perform any movement between interruption and continuation.

Structure of the application

The application consists of a simple state machine in the PLC_PRG program and a trace to easily track the state transitions.

  1. First, the axes and axis group are enabled. (STATE_POWER_ON)

  2. Then, two movements, moveLinearA and moveLinearB, are commanded with blending. (STATE_START_MOVING)

  3. As soon as the second movement is active (when blending begins), the movement is interrupted. The cause could be, for example, that a tool defect has been detected. (STATE_INTERRUPT)

  4. A relative PTP movement is performed in the positive Z-direction, for example, to replace the tool after the defect. (STATE_INTERMEDIATE_MOVEMENT)

  5. Before resuming, the system returns to the position where the original movement was interrupted. (STATE_GET_CONTINUE_POS/STATE_MOVE_TO_CONTINUE_POS)

  6. The original movement is resumed. (STATE_CONTINUE)

Usage

Compile the created program and log in. To track the different states, you can download the trace to the controller. Start the application.

_sm_img_robotics_example_interrupt.png